#include <iostream>
using namespace std;

class Person
{
public:
    Person()
    {
        cout<<"Person()"<<endl;
    }
    virtual ~Person()
    {
        cout<<"~Person()"<<endl;
    }

    virtual void run()
    {
        cout<<"Person::run()"<<endl;
    }
};

class Student:public Person
{
public:
    Student()
    {
        cout<<"Student()"<<endl;
    }
    ~Student()
    {
        cout<<"~Student()"<<endl;
    }

    void run()
    {
        cout<<"Student::run()"<<endl;
    }

    void study()
    {
        cout<<"Student::study()"<<endl;
    }

public:
    int m_score;
};

int main()
{
    const char * str = "hello world";


//*ptr = num2;
//ptr = &num2;
    #if 0
    char *buffer = static_cast<char *>(str);
    char *buffer = const_cast<char *>(str);
    #endif

    cout<<"str:"<<str<<endl;
    Person *p1 = new Person();
    Person *p2 = new Student();
    p1->run();
    p2->run();
    
    delete p1;
    delete p2;
    /* static没有安全检测 */
}